#pragma once

#define FORCEINLINE inline
#define CONSTEXPR constexpr

/** 针对C++特性定义*/

#define NORETURN [[noreturn]]
#define NOEXCEPT noexcept

// 针对enum class 无法进行隐式转化，显示定义对应运算符操作
#define DEFINE_ENUM_CLAZZ_OPERATORS(ENUM_NAME)                                                                                      \
    constexpr inline ENUM_NAME operator~(ENUM_NAME a) { return static_cast<ENUM_NAME>(~(int)a); }                                   \
    constexpr inline ENUM_NAME operator|(ENUM_NAME a, ENUM_NAME b) { return static_cast<ENUM_NAME>((int)a | (int)b); }              \
    constexpr inline ENUM_NAME operator&(ENUM_NAME a, ENUM_NAME b) { return static_cast<ENUM_NAME>((int)a & (int)b); }              \
    constexpr inline ENUM_NAME operator^(ENUM_NAME a, ENUM_NAME b) { return static_cast<ENUM_NAME>((int)a ^ (int)b); }              \
    constexpr inline ENUM_NAME &operator|=(ENUM_NAME &a, ENUM_NAME b) { return reinterpret_cast<ENUM_NAME &>((int &)a |= (int)b); } \
    constexpr inline ENUM_NAME &operator&=(ENUM_NAME &a, ENUM_NAME b) { return reinterpret_cast<ENUM_NAME &>((int &)a &= (int)b); } \
    constexpr inline ENUM_NAME &operator^=(ENUM_NAME &a, ENUM_NAME b) { return reinterpret_cast<ENUM_NAME &>((int &)a ^= (int)b); }

#include "macro.h"